file(GLOB
  source_files
  "*.c")

FOREACH (test ${source_files})

  get_filename_component(exec ${test} 
    NAME_WE)

  ADD_EXECUTABLE(${exec}
    ${exec}.c)

  TARGET_LINK_LIBRARIES(${exec}
    libthread.a)

  ADD_TEST(${exec} ${exec} 
    COMMANDE ./${exec} 10 10)

ENDFOREACH (test)